package homework.h01;
/**
 * @author thinkpad - 83start
 * @version v1.0
 * @create 2022/9/1 16:14
 * @package h01
 * @description 编写程序，提示用户输入一个4位数的正整数，该程序将以每行一个数字输出该数。
 */

public class SplitAllNumbers {
    static char[] splitAllNumber(int number) {
        String s = String.valueOf(number);
        char[] chars = new char[s.length()];
        for (int i = 0; i < s.length(); i++) {
            chars[i] = s.charAt(i);
        }
        return chars;
    }

    static void p(int n) {
        if (n == 0) {
            return;
        } else {
            System.out.println(n % 10);
            p(n / 10);
        }
    }

    static void p2(int n) {
        if (n > 9) {
            p2(n / 10);
        }
        int result = n % 10;
        System.out.println(result);
    }

    public static void main(String[] args) {

//        int i = new Scanner(System.in).nextInt();
//        char[] chars = splitAllNumber(i);
//
//        for (char element:chars
//             ) {
//            System.out.println(element);
//        }

        p2(1234);
    }
}